package mall

import (
	"ginfast/api/mall/controller"
	"ginfast/api/mall/model"

	"github.com/gin-gonic/gin"
)

// Routers 路由初始化
func Routers(r *gin.RouterGroup) {
	controller.Category{}.Routers(r.Group("/category"))
	controller.Goods{}.Routers(r.Group("/goods"))
	controller.User{}.Routers(r.Group("/user"))
	controller.Brand{}.Routers(r.Group("/brand"))
	controller.UserAddress{}.Routers(r.Group("/user/addr"))
	controller.Consumption{}.Routers(r.Group("/consumption"))
	controller.Order{}.Routers(r.Group("/order"))
}

func Models() []interface{} {
	return []interface{}{
		&model.User{},
		&model.UserAddress{},
		&model.Category{},
		&model.Goods{},
		&model.Order{},
		&model.Consumption{},
	}
}
